package com.fulihui.usercore.core.repository;

import com.fulihui.usercore.dal.dataobj.WechatUserExample;
import com.fulihui.usercore.dto.WechatUserDTO;

import java.util.List;

/**
 * @author Willard.Hu on 2016/5/21.
 */
public interface WechatUserRepository {

    void create(WechatUserDTO dto);

    boolean modify(WechatUserDTO dto);

    boolean updateDsiable(int disbale, String userId);

    List<WechatUserDTO> queryDsiabled();

    WechatUserDTO queryByPK(long id);

    /**
     * 用户 openId、openIdType 和微信 appid 再加上隐藏查询条件 disable=0 定位到唯一数据
     *
     * @param openId     openId
     * @param openIdType openIdType
     * @param appid      appid
     * @return {@link WechatUserDTO}
     */
    @Deprecated
    WechatUserDTO querySingle(String openId, String openIdType, String appid);

    List<WechatUserDTO> queryByUnionid(String unionid, String appid);

    List<WechatUserDTO> queryByUserIds(List<String> userIds, String appid);

    List<WechatUserDTO> query(WechatUserExample example);

    WechatUserDTO queryByUnionid(String unionid, String openIdType, String appid);
}
